package com.nnxy.controller;

import com.nnxy.pojo.Result;
import com.nnxy.pojo.StuCount;
import com.nnxy.pojo.StuDegree;
import com.nnxy.service.StuDegreeService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
 * @Title: StuDegreeController
 * @Author: Jer.
 * @Date: 2025/4/22 20:47
 */
@Slf4j
@RestController
@RequestMapping("/report")
public class StuDegreeController {
    @Autowired
    private StuDegreeService stuDegreeService;

    @GetMapping("/studentDegreeData")
    public Result getStuDegreeData() {
        log.info("学员学历统计");
        List<StuDegree> stuDegree = stuDegreeService.getStuDegreeData();
        return new Result(1, "success", stuDegree);
    }

    @GetMapping("/studentCountData")
    public Result getStudentCountDate() {
        log.info("各个班级的人数统计");
        StuCount stuCount = stuDegreeService.getStuCountDate();
        return new Result(1,"success",stuCount);
    }
}
